<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="./style.css" />
    <title>bubbles</title>
  </head>
  <body>
    <section class="main">
      <h1>
        Bubbles
      </h1>
    </section>
    <script type="text/javascript">
      function createBubbles() {
        const section = document.querySelector("section");
        const createElement = document.createElement("span");
        let size = Math.random() * 60;
        createElement.style.width = 20 + size + "px";
        createElement.style.height = 20 + size + "px";
        createElement.style.left = Math.random() * innerWidth + "px";
        section.appendChild(createElement);

        setTimeout(() => {
          createElement.remove();
        }, 4000);
      }
      setInterval(createBubbles, 100);
    </script>
  </body>
</html>
